home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / formats / tiff_f / tiff_f.doc < prev   
Text File  |  1991-04-23  |  17KB  |  438 lines

  1. >From: sl@van-bc.UUCP (Stuart Lynne)
  2. Newsgroups: alt.fax,comp.graphics
  3. Subject: TIFF-F Revised Specification
  4.  
  5. Date: 28 Apr 90 06:52:03 GMT
  6. Organization: Wimsey Associates, Vancouver, B.C., Canada
  7. Lines: 426
  8.  
  9.  
  10.  
  11. This is the most recent revision of the TIFF Class F specification from 
  12. Joe Campbell at Cygnet.
  13.  
  14. ----------------------------------------------------------------------------
  15.  
  16.  
  17.                    THE SPIRIT OF TIFF CLASS F
  18.  
  19. TIFF Classes reduce the information burden on TIFF readers and writers 
  20. that wish to support narrow applications. For example, Appendix G-1 of 
  21. TIFF 5.0 states that classes enable TIFF readers "to know when they 
  22. can stop adding TIFF features."  In other words, defining a Class 
  23. enables applications interested only in reading that Class to give up 
  24. if the characteristic tags and values are not present.  Therefore, 
  25. TIFF Class F insists on a rather narrow definition of tags. In a 
  26. general TIFF file, for example, the writer would be free to create 
  27. single-page documents without the NewSubFileType and PageNumber tags.  
  28. Not so for a Class F file, where the multi-page tag is required even 
  29. for a single page.
  30.  
  31. TIFF Class F is a sub-class of Class B (Bilevel).  That is, all tags 
  32. that are required in Class B are also required in Class F. For some 
  33. common tags, however, Class F limits the range of acceptable values.  
  34. The YResolution tag, for example, is a Class B tag, but its Class F 
  35. value is limited to either 98 or 196 dpi. Such tags are listed in 
  36. "Required Class F Tags."
  37.  
  38. Other Class B tags have a slightly eccentric meaning when applied to 
  39. facsimile images.  These are discussed in the section "Bilevel 
  40. Required."
  41.  
  42. There are also tags that may be helpful but are not required. These 
  43. are listed in the "Recommended Tags" section.
  44.  
  45. Finally, technical topics are discussed in the sections "Technical 
  46. Points" and "Warnings."
  47.  
  48.                    REFERENCES
  49.  
  50. Substantive questions about TIFF Class F can be faxed to:
  51.  
  52.           Cygnet Technologies
  53.           2560 9th, Suite 220
  54.           Berkeley, CA 94710
  55.           Fax: (415) 540-5835
  56.  
  57. TIFF Class F is a parallel but unrelated effort to EIA Project Number 
  58. 2188, an industry standards group working to standardize facsimile 
  59. hardware. For information about this standard, contact Joe Decuir at 
  60. the above address or phone (415) 486-2611.
  61.  
  62. Group 3 facsimile is described in the "Red Book", Volume VII, Fascicle 
  63. VII.3, Terminal Equipment and Protocols for Telematic Services, The 
  64. International Telegraph and Telephone Consultative Committee (CCITT), 
  65. Geneva, 1985.
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.                         CLASS F REQUIRED
  73.  
  74.      Compression = 3.  SHORT.   Group 3, one- dimensional encoding 
  75. with "byte-aligned" EOLs.  An EOL is  said to be byte-aligned when 
  76. Fill bits have been added as  necessary before EOL codes such that EOL 
  77. always ends on a byte  boundary, thus ensuring an EOL-sequence of a 1 
  78. byte preceded  by a zero nibble: xxxx0000 00000001.  The data in a 
  79. Class F image is not terminated with an RTC.  Please see items 4 and 5 
  80. in the "Warnings" section.
  81.  
  82.    For two-dimensional encoding, set bit 1 in Group3Options. Please 
  83. see item 2 in the "Warnings" section.
  84.  
  85.      FillOrder = 1, 2.  SHORT.  TIFF Class F readers must be able to 
  86. read data in both bit orders, but the vast majority of facsimile 
  87. products store data LSB first, exactly as it appears on the telephone 
  88. line.
  89.  
  90.         1 = Most Significant Bit first.
  91.  
  92.         2 = Least Significant Bit first.
  93.  
  94.      Group3Options = 4,5.  LONG.  Data may be one- or two-dimensional, 
  95. but EOLs must be byte-aligned. Uncompressed data is not allowed.
  96.  
  97.         bit 0 = 0 for 1-Dimensional, 1 for 2-Dimensional
  98.  
  99.         bit 1 = must be 0 (uncompressed data not allowed)
  100.  
  101.         bit 2 = 1 for byte-aligned EOLs
  102.  
  103.      ImageWidth = 1728, 2048, 2482.  SHORT or LONG.  These are the 
  104. fixed page widths in pixels defined in CCITT Group 3.
  105.  
  106.      NewSubFileType = 2.  LONG.  The value 2 identifies a single page 
  107. of a multi-page image.
  108.  
  109.      PageNumber.  SHORT/SHORT.  This tag specifies the page numbers in 
  110. the fax document.  The tag comprises two SHORT values: the first value 
  111. is the page number, the second is the total number of pages. Single-
  112. page documents therefore use 00000001 hex.
  113.  
  114.      ResolutionUnit = 2,3.  SHORT.  The units of measure for 
  115. resolution:
  116.  
  117.         2 = Inch
  118.  
  119.         3 = Centimeter
  120.  
  121.      XResolution = 204 (inches).  RATIONAL. The horizontal resolution 
  122. of the image expressed in pixels per resolution unit.
  123.  
  124.      YResolution = 98, 196 (inches).  RATIONAL. The vertical 
  125. resolution of the image expressed in pixels per resolution unit.
  126.  
  127.                    BILEVEL REQUIRED
  128.  
  129. Although these tags are already required in Class B (Bi-Level) files, 
  130. an explanation of their usage for facsimile images may be helpful.
  131.  
  132.      BitsPerSample = 1.  SHORT.  Since facsimile is a black-and-white 
  133. medium, this must be 1 (the default) for all files.
  134.  
  135.      ImageLength.  SHORT or LONG.  LONG recommended. The total number 
  136. of scan lines in the image.
  137.  
  138.      PhotometricInterp = 0,1.  SHORT.  This tag allows notation of an 
  139. inverted ("negative") image:
  140.  
  141.         0 = normal
  142.  
  143.         1 = inverted
  144.  
  145.      Software.  ASCII.  The optional name and release number of the 
  146. software package that created the image.
  147.  
  148.      RowsPerStrip.  SHORT or LONG.  LONG recommended. The number of 
  149. scan lines per strip.  When a page is expressed as one large strip, 
  150. this is the same as the ImageLength tag.
  151.  
  152.      SamplesPerPixel = 1.  SHORT.  The value of 1 denotes a bi-level, 
  153. grayscale, or palatte color image.
  154.  
  155.      StripByteCounts.  SHORT or LONG.  SHORT recommended. For each 
  156. strip, the number of bytes in that strip. If a page is expressed as 
  157. one large strip, this is the total number of bytes in the page after 
  158. compression.
  159.  
  160.      StripOffsets.  SHORT or LONG.  For each strip, the offset of that 
  161. strip.  The offset is measured from the beginning of the file. If a 
  162. page is expressed as one large strip, there is one such entry per 
  163. page.
  164.  
  165.                    NEW TAGS
  166.  
  167. There are only three new tags for Class F.  All three tags describe 
  168. page quality.  The information contained in these tags is usually 
  169. obtained from the receiving facsimile hardware, but since not all 
  170. devices are capable of reporting this information, the tags are 
  171. optional.
  172.  
  173. Some applications need to understand exactly the error content of the 
  174. data.  For example, a CAD program might wish to verify that a file has 
  175. a low error level before importing it into a high- accuracy document.  
  176. Because Group 3 facsimile devices do not necessarily perform error 
  177. correction on the image data, the quality of a received page must be 
  178. inferred from the pixel count of decoded scan lines. A "good" scan 
  179. line is defined as a line that, when decoded, contains the correct 
  180. number of pixels. Conversely, a "bad" scan line is defined as a line 
  181. that, when decoded, comprises an incorrect number of pixels.
  182.      BadFaxLines
  183.          Tag  = 326  (146 hex)
  184.          Type = SHORT or LONG
  185.  
  186. This tag reports the number of scan lines with an incorrect number of 
  187. pixels encountered by the facsimile during reception (but not 
  188. necessarily in the file).
  189.  
  190.                Note: PercentBad = (BadFaxLines/ImageLength) * 100
  191.  
  192.  
  193.      CleanFaxData
  194.          Tag = 327 (147 hex)
  195.          Type = SHORT
  196.  
  197.             N = 0
  198.  
  199.                          0 = Data  contains  no lines  with  incorrect 
  200.                              pixel counts or regenerated lines  (i.e., 
  201.                              computer generated)
  202.  
  203.  
  204.                          1 = Lines with an incorrect pixel count  were 
  205.                              regenerated by receiving device
  206.  
  207.  
  208.                          2 = Lines  with  an  incorrect  pixel   count 
  209.                              existed,  but  were  not  regenerated  by 
  210.                              receiving device
  211.  
  212. Many facsimile devices do not actually output bad lines. Instead,  the 
  213. previous good line is repeated in place of a bad  line. Although  this 
  214. substitution,  known  as  line   regeneration,  results  in  a  visual 
  215. improvement  to the image,  the data is nevertheless  corrupted.   The 
  216. CleanFaxData  tag  describes the error content of the data.  That  is, 
  217. when the  BadFaxLines and ImageLength tags indicate that the facsimile  
  218. device  encountered lines with an incorrect number of  pixels   during 
  219. reception,  the  CleanFaxData tag indicates whether these   lines  are 
  220. actually  in the data or if the receiving facsimile   device  replaced 
  221. them with regenerated lines.
  222.  
  223.      ConsecutiveBadFaxLines
  224.          Tag  = 328 (148 hex)
  225.          Type =  LONG or SHORT
  226.  
  227. This tag reports the maximum number of consecutive lines containing an 
  228. incorrect number of pixels encountered by the facsimile device  during 
  229. reception (but not necessarily in the file).
  230.  
  231. The  BadFaxLines  and ImageLength data indicate only the  quantity  of 
  232. such  lines.  The ConsecutiveBadFaxLines tag is an indicator of  their 
  233. distribution  and  may  therefore be a  better  general  indicator  of 
  234. perceived image quality.
  235.  
  236.  
  237.                         RECOMMENDED TAGS
  238.  
  239.      BadFaxLines.  LONG.  The number of "bad" scan lines 
  240. encountered by the facsimile during reception.
  241.  
  242.      CleanFaxData = 0, 1, 2.  BYTE.  This tag indicates whether 
  243. lines with incorrect pixel count are actually in the data or if 
  244. the receiving facsimile device replaced them with regenerated 
  245. lines.
  246.  
  247.                          0 = Data contains no lines with incorrect 
  248.                              pixel counts or regenerated lines (i.e., 
  249.                              computer generated)
  250.  
  251.                          1 = Lines with an incorrect pixel count were 
  252.                              regenerated by receiving device
  253.  
  254.                          2 = Lines with an incorrect pixel count 
  255.                              existed, but were not regenerated by 
  256.                              receiving device
  257.  
  258.      ConsecutiveBadFaxLines.  LONG or SHORT. The maximum number of 
  259. consecutive scan lines with incorrect pixel count encountered by the 
  260. facsimile device reception.
  261.  
  262.      DateTime.  ASCII.  Date and time in the format YYYY:MM:DD 
  263. HH:MM:SS, in 24-hour format. String length including NUL byte is 20 
  264. bytes. Space between DD and HH.
  265.  
  266.      DocumentName.  ASCII.  This is the name of the document from 
  267. which the document was scanned.
  268.  
  269.      ImageDescription.  ASCII.  This is an ASCII string describing the 
  270. contents of the image.
  271.  
  272.      Orientation.  SHORT.  This tag might be useful for displayers 
  273. that always want to show the same orientation, regardless of the 
  274. image.  The default value of 1 is "0th row is visual top of image, and 
  275. 0th column is the visual left."  An 180-degree rotation is 3.  See 
  276. TIFF 5.0 for an explanation of other values.
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.                    TECHNICAL POINTS
  293.  
  294. 1.  Strips  Those new to TIFF may not be familiar with the concept of 
  295. "strips" embodied in the three tags RowsPerStrip, StripByteCount, 
  296. StripOffsets.
  297.  
  298.      In general, third-party applications that read and write TIFF 
  299. files expect the image to be divided into "strips," also known as 
  300. "bands."  Each strip contains a few lines of the image. By using 
  301. strips, a TIFF reader need not load the entire image into memory, thus 
  302. enabling it to fetch and decompress small random portions of the image 
  303. as necessary.
  304.  
  305.      The dimensions of a strip are described by the RowsPerStrip and 
  306. StripByteCount tags.  The location in the TIFF file of each strip is 
  307. contained in the StripOffsets tag.
  308.  
  309.      The TIFF documentation suggests using strips of an arbitrary size 
  310. of about 8K.  Although various application programs assert that they 
  311. "prefer" banded images, research failed to uncover a single existing 
  312. application that could not read a single-strip page where they could 
  313. read the same file in a multi- strip format. Indeed, applications seem 
  314. to be more sensitive to the total size of the decoded image and are 
  315. not particularly fussy about banding.  This result is not surprising, 
  316. considering that most desktop publishing programs are prepared to deal 
  317. with massively larger images than those one finds in facsimile.  In 
  318. short, each page may be represented as a single strip of any length.
  319.  
  320.      In fact, there may be a compelling reason to employ a strip size 
  321. equal to the length of one A4 page (297 mm).  When a document is 
  322. imaged, it may be of any length.  Not all fax machines, however, can 
  323. accept unlimited length documents. Worse, the remote machine's page-
  324. length capability is not known until the fax connection has been 
  325. established.  The solution is for the transmitting fax device to image 
  326. long documents into A4-size strips, then seam them together at 
  327. transmission, after the capabilities of the remote fax machine is 
  328. known.
  329.  
  330. 2.  Bit Order  Although the TIFF 5.0 documentation lists the FillOrder 
  331. tag in the category "No Longer Recommended," Class F resurrects it. 
  332. Facsimile data appears on the phone line in bit-reversed order 
  333. relative to its description in CCITT Recommendation T.4.  Therefore, a 
  334. wide majority of facsimile applications choose this natural order for 
  335. storage. Nevertheless, TIFF Class F readers must be able to read data 
  336. in both bit orders.
  337.  
  338. 3.  Multi-Page  Many existing applications already read Class F-like 
  339. files, but do not support the multi- page tag.  Since a multi-page 
  340. format greatly simplifies file management in fax application software, 
  341. Class F specifies multi- page documents (NewSubfileType = 2).
  342.  
  343. 4.  Two-dimensional Encoding  PC Fax applications that wish to support 
  344. two-dimensional encoding may do so by setting Bit 0 in the 
  345. Group3Options tag.  Please see item 2 in the "Warnings" section.
  346.  
  347.  
  348.  
  349. 5.  Example Use of Page-quality Tags  Here are examples for writing 
  350. the CleanFaxData,  BadFaxLines, and ConsecutiveBadFaxLines tags:
  351.  
  352.      1.  Facsimile hardware does not provide page quality information: 
  353. write no tags.
  354.  
  355.      2.  Facsimile hardware provides page quality information, but 
  356. reports no bad lines.  Write only BadFaxLines = 0.
  357.  
  358.      3.  Facsimile hardware provides page quality information, and 
  359. reports bad lines.  Write both BadFaxLines and ConsecutiveBadFaxLines.  
  360. Also write CleanFaxData = 1 or 2 if the hardware's regeneration 
  361. capability is known.
  362.  
  363.      4.  Computer generated file:  write CleanFaxData = 0.
  364.  
  365.  
  366.               WHAT CONSTITUTES TIFF CLASS F SUPPORT
  367.  
  368. Fax applications that do not wish to embrace TIFF Class F as a native 
  369. format may elect to support it as import/export medium.
  370.  
  371.      Export  The simplest form of support is a Class F writer that 
  372. produces individual single-page Class F  files with the proper 
  373. NewSubFile tag and the PageNumber (page  one-of-one) tag.
  374.  
  375.      Import  A Class F reader must be able to handle a Class F file 
  376. containing multiple pages.
  377.  
  378.                             WARNINGS
  379.  
  380. 1.  Class F requires the ability to read and write at least one- 
  381. dimensional T.4 Huffman ("compressed") data. Due to the disruptive 
  382. effect to application software of line-length  errors and because such 
  383. errors are likely in everyday facsimile transmissions, uncompressed 
  384. data is not allowed.  In other words, "Uncompressed" bit in 
  385. Group3Options must be 0.
  386.  
  387. 2.  Since two-dimensional encoding is not required for Group 3 
  388. compatibility, Class F readers may decline to read such files. 
  389. Therefore, for maximum portability write only one- dimensional files.  
  390. Although the same argument technically holds for "fine" (196 dpi) 
  391. vertical resolution, only a tiny fraction of facsimile products 
  392. support only 98 dpi.  Therefore, high-resolution files are quite 
  393. portable in the real world.
  394.  
  395. 3.  In the spirit of TIFF, all EOLs in data must be byte- aligned. An 
  396. EOL is said to be byte-aligned when Fill bits have been added as 
  397. necessary before EOL codes such that EOL always ends on a byte 
  398. boundary, thus ensuring an  EOL-sequence of a one byte preceded by a 
  399. zero nibble: xxxx0000 00000001.
  400.  
  401.      Recall that Huffman encoding encodes bits, not bytes. This means 
  402. that the end-of-line token may end in the middle of a byte. In byte 
  403. alignment, extra zero bits (Fill) are added so that the first bit of 
  404. data following an EOL begins on a byte boundary. In effect, byte 
  405. alignment relieves application software of the burden of bit-shifting 
  406. every byte while parsing scan lines for line-oriented image 
  407. manipulation (such as writing a TIFF file).
  408.  
  409. 4.  As illustrated in FIGURE 1/T.4 in Recommendation T.4 (the Red 
  410. Book, page 20), facsimile documents begin with an EOL (which in Class 
  411. F is byte-aligned). The last line of the image is not terminated by an 
  412. EOL.
  413.  
  414. 5.  Aside from EOL's, TIFF Class F files contain only image data. This 
  415. means that the Return To Control sequence (RTC) is specifically 
  416. prohibited. Exclusion of RTC's not only makes possible the simple 
  417. concatenation of images, it eliminates the mischief--failed 
  418. communications and unreadable images--that their mistreatment 
  419. inevitably produces.  (This view is reflected in the work of the EIA 
  420. PN2188 committee, where the modem device attaches the  RTC outbound 
  421. and removes it inbound.)
  422.  
  423.                         REVISION HISTORY
  424.  
  425. 11/17/89: Initial Publication
  426.  
  427. 4/29/90 : First revision
  428.  
  429. PageNumber tag was incorrectly illustrated as page one. The correct
  430. number for the first page is zero.
  431.  
  432.  
  433.  
  434. -- 
  435. Stuart.Lynne@wimsey.bc.ca ubc-cs!van-bc!sl 604-937-7532(voice) 604-939-4768(fax)
  436.  
  437.  
  438.